home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / CLMUTEX.HPP < prev    next >
C/C++ Source or Header  |  1993-07-15  |  3KB  |  81 lines

  1. //----------------------------------------------------------------------------
  2. //                            MODULE DESCRIPTION
  3. //
  4. //  Module:    clmutex.hpp
  5. //   Title:    C++ Class Libraries
  6. //  Notice:    John M. Weeder
  7. //                 Copyright (c) 1993. All rights reserved.
  8. //             This module contains proprietary information and should be 
  9. //                treated as confidential.
  10. //
  11. //----------------------------------------------------------------------------
  12. //                           MAINTENANCE HISTORY
  13. //
  14. // $Workfile$
  15. // $Revision$
  16. //   $Author$
  17. //     $Date$
  18. //      $Log$    
  19. //
  20. //----------------------------------------------------------------------------
  21. //                             MODULE NARRATIVE
  22. //
  23. //    This module contains code for the class XXX.
  24. //
  25. //    The code in this module may be written in C++ or C.
  26. //
  27. //    This module is portable to:
  28. //        DOS 3.X+
  29. //        MS Windows 3.X+
  30. //        OS/2 2.X+
  31. //        OS/2 2.0 PM
  32. //
  33. //    The following compilers are supported:
  34. //        MSC 6.0A
  35. //        MSC/C++ 7.0
  36. //        Borland C++ 3.1 for DOS
  37. //        Borland C++ 1.0 for OS/2 2.X
  38. //
  39. //----------------------------------------------------------------------------
  40.  
  41. //----------------------------------------------------------------------------
  42. //    Class CL_MUTEX
  43. //----------------------------------------------------------------------------
  44. #define CL_MUTEX_PARENT CL_OBJECT
  45. class CLASSTYPE CL_MUTEX : public CL_MUTEX_PARENT
  46. {
  47. #if OS_OS2
  48.     HMTX hmtx;                                    // Semaphore
  49.    TID tid;                               // Owning thread, 0 = none 
  50.     SIZET cLock;                            // Number of times locked by this thread
  51.     BOOL fCreate;                                // Semaphore created
  52. #endif
  53.  
  54. public:
  55.     FN_M CL_MUTEX();
  56.     FN_M CL_MUTEX(RCCL_MUTEX);
  57.     virtual FN_M ~CL_MUTEX();
  58.  
  59.     virtual BOOL FN_M Destroy(BOOL = TRUE);
  60.     virtual BOOL FN_M Initialize(SHORT = CL_INIT_ALL);
  61.     virtual BOOL FN_M IsError() const;
  62.     virtual BOOL FN_M IsValid() const;
  63.     RCCL_MUTEX FN_M operator=(RCCL_MUTEX);
  64.     BOOL FN_M Release();
  65.     BOOL FN_M Request(LONG = -1);
  66.     virtual BOOL FN_M Retrieve(PCSZ, PCSZ = NULL);
  67.     virtual BOOL FN_M Store(PCSZ, PCSZ = NULL);
  68.  
  69. #if COMPILE_DEBUG
  70.     static VOID FN_M Print(PCCL_MUTEX = NULL, PCSZ = NULL, SIZET = 0);
  71.     static BOOL FN_M Test(SHORT = 0);
  72. #endif
  73.  
  74. protected:
  75.  
  76. private:
  77. };
  78. //----------------------------------------------------------------------------
  79. //------------------------------- End of File --------------------------------
  80. //----------------------------------------------------------------------------
  81.